package cn.getech.data.development.controller.real;

import cn.getech.data.intelligence.common.utils.PageReq;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

@ApiModel(description = "数据查询")
@Data
public class RealSearchReq extends PageReq {
    @ApiModelProperty(value = "调度名称")
    private String queueName;

    @ApiModelProperty(value = "项目id")
    private Integer projectId;

    @ApiModelProperty(value = "表名称名称")
    private String taskName;

    /**
     * 0 失败 1 成功 2 运行中 3 未运行
     * @see cn.getech.data.development.constant.RunStatus
     */
    @ApiModelProperty(value = "运行状态")
    private Integer runState;

    @ApiModelProperty(value = "运行开始时间")
    private String startTime;
    @ApiModelProperty(value = "运行结束时间")
    private String endTime;
    @ApiModelProperty(value = "租户id")
    private Integer tenantId;

    public String getStartTime() {
        return StringUtils.isNotEmpty(startTime) ? startTime + " 00:00:00" : null;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return StringUtils.isNotEmpty(endTime) ? endTime + " 23:59:59" : null;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
}
